package org.spring.aspectj;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

/**
 * Created by chinalin on 2017/3/19.
 */
@Aspect
@Component
public class GreetingAspect {

//    @Around("execution(* org.entry.GreetingImpl.*(..))")
    @Around("@annotation(org.annotation.Tag)")
    public Object around(ProceedingJoinPoint pjp) throws Throwable{
        before();
        Object obj = pjp.proceed();
        after();
        return obj ;
    }

    @DeclareParents(value = "org.spring.aspectj.GreetingImpl", defaultImpl = org.spring.aspectj.GreetingSorryImpl.class)
    private org.entry.GreetingSorry greetingSorry ;

    private void before(){
        System.out.println("Asbefore11");
    }
    private void after(){
        System.out.println("Asafter11");
    }
}
